﻿Public Class FrmMain : Inherits Library.MainForm

	Sub New()
		InitializeComponent()
	End Sub

	Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
		MyBase.OnLoad(e)
		Connect()
		FrmLogin.AppKey = "istihdam"
		If FrmLogin.ShowDialog = Windows.Forms.DialogResult.Cancel Then Close() : End
		CorrectCases()
		Dim Isci As New Isci
		Controls.Add(Isci)
		Isci.BringToFront()
		Isci.Dock = DockStyle.Fill
		TabStrip.AddTab("İşçi başvuruları", My.Resources.istihdam, Isci, True)
		Dim Reports As New Reports
		Controls.Add(Reports)
		Reports.BringToFront()
		Reports.Dock = DockStyle.Fill
		TabStrip.AddTab("Raporlar", My.Resources.document, Reports, True)
		TabStrip.Tabs(0).Activate()
	End Sub

	Overrides Sub Connect()
		OpenConnection("172.25.10.9", "pizin", "pizinadmin", "relayer", "istihdam")
	End Sub

	Private Sub CorrectCases()
		Dim Rs As Recordset
		If 1 = 1 Then Return
		For Each Item In "egitim.meslek".Split(".")
			Rs = OpenSQL("select * from " & Item)
			Do Until Rs.EOF
				Rs("adi") = ToTitle(Rs("adi"))
				Rs.MoveNext()
			Loop
			Rs.Save()
		Next
		Rs = OpenSQL("select * from istihdam")
		Do Until Rs.EOF
			Rs("adi") = ToTitle(IsNull(Rs("adi"), ""))
			Rs("soyadi") = ToTitle(IsNull(Rs("soyadi"), ""))
			Rs.MoveNext()
		Loop
		Rs.Save()
	End Sub

End Class
